function login(){
	if(addContractService.staffId.value == ""){
		alert("请输入员工编号！！！");
		addContractService.staffId.focus();
		return false;
	}
	if(addContractService.contractServiceTypeId.value == ""){
		alert("请输入员工合同类型！！！");
		addContractService.contractServiceTypeId.focus();
		return false;
			
		}
	if(addContractService.contractServiceStart.value == ""){
		alert("请输入合同开始日期！！！");
		addContractService.contractServiceStart.focus();
		return false;
	}
	if(addContractService.contractServiceEnd.value == ""){
		alert("请输入合同结束日期！！！");
		addContractService.contractServiceEnd.focus();
		return false;
	}
	if(addContractService.upload.value == ""){
		alert("请上传文件！！！");
		addContractService.upload.focus();
		return false;
	}
	return true;	
}

function isStaffExist(staffId){
	var flag = false;
	var fn = function(result){
		flag = result;
	}
	dwr.engine.setAsync(false);
	checkStaffService.isExist(staffId,fn);
	dwr.engine.setAsync(true);
	return flag;
}
// 验证是否符合数字格式

function checkstaffId() {
	var staffId = document.getElementById("staffId").value;
	var regu = "^[0-9]+$";
	if (staffId.search(regu) != -1) {
		if (isStaffExist(staffId)) {
			return true;
		} else {
			alert("员工编号不存在");
			return false;
		}
	} else {
		alert("请将员工编号输入为数字！！！");
		return false;
	}
}


